﻿using System.Collections.Generic;
using System.Web.Http;
using FilterModel;
using IBll;
using MainService.Controllers.Extend;
using ResponseModel;

namespace MainService.Controllers
{
    /// <summary>
    /// 测试控制器
    /// </summary>
    public class TestController : BaseApiController
    {
        public ITestBll TestBll { get; set; }

        /// <summary>
        /// 获取字符串
        /// </summary>
        /// <returns></returns>
        [HttpPost]
        public string GetString(dynamic dynObj)
        {
            string str = TestBll.GetTestStr(dynObj.TestId.ToString());

            return str;
        }

        /// <summary>
        /// 获取数字
        /// </summary>
        /// <returns></returns>
        [HttpPost]
        public int GetInt()
        {
            int a = 6;

            return a;
        }

        /// <summary>
        /// 获取bool
        /// </summary>
        /// <returns></returns>
        [HttpPost]
        public bool GetBool()
        {
            bool a = true;

            return a;
        }

        /// <summary>
        /// 获取TestResponse
        /// </summary>
        /// <returns></returns>
        [HttpPost]
        public TestResponse GetTestResponse()
        {
            return new TestResponse() {Key = "6", Value = "6"};
        }

        /// <summary>
        /// 获取TestResponseList
        /// </summary>
        /// <returns></returns>
        [HttpPost]
        public List<TestResponse> GetTestResponseList()
        {
            List<TestResponse> testResponseList = new List<TestResponse>();
            testResponseList.Add(new TestResponse() { Key = "2", Value = "2" });
            testResponseList.Add(new TestResponse() { Key = "6", Value = "6" });
            return testResponseList;
        }
    }
}
